<template>
  <!-- 组件的结构 -->
  <div class="demo">
    <p>学校名称：{{name}}</p>
    <p>学校地址：{{address}}</p>
    <Student></Student>
  </div>
</template>

<script>
import Student from './Student'
export default {
  name: 'School', // 最好与文件名一致
  data() {
    return {
      name: 'DLUT',
      address: '大连'
    }
  },
  components: {
    Student
  },
  mounted() {
    this.$bus.$on('getStudentInfo', data => {
      console.log(data)
    })
  }
}
</script>

<style>
/* 组件的样式 */
.demo {
  width: 100%;
  height: 500px;
  background-color: pink;
}
</style>